<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Service_SlideShare - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.service.slideshare.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.service.slideshare.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.simpy.html">Zend_Service_Simpy</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.service.slideshare" class="section"><div class="info"><h1 class="title">Zend_Service_SlideShare</h1></div>
    

    <p class="para">
        The <span class="classname">Zend_Service_SlideShare</span> component is used to interact with the
        <a href="http://www.slideshare.net/" class="link external">&raquo; slideshare.net</a> web services for hosting
        slide shows online. With this component, you can embed slide shows which are hosted on this
        web site within a web site and even upload new slide shows to your account.
    </p>

    <div class="section" id="zend.service.slideshare.basicusage"><div class="info"><h1 class="title">Getting Started with Zend_Service_SlideShare</h1></div>
        

        <p class="para">
            In order to use the <span class="classname">Zend_Service_SlideShare</span> component you must
            first create an account on the slideshare.net servers (more information can be found
            <a href="http://www.slideshare.net/developers/" class="link external">&raquo; here</a>) in order to receive an
            <acronym class="acronym">API</acronym> key, username, password and shared secret value -- all of which
            are needed in order to use the <span class="classname">Zend_Service_SlideShare</span> component.
        </p>

        <p class="para">
            Once you have setup an account, you can begin using the
            <span class="classname">Zend_Service_SlideShare</span> component by creating a new instance of
            the <span class="classname">Zend_Service_SlideShare</span> object and providing these values as
            shown below:
        </p>

        <pre class="programlisting brush: php">
// Create a new instance of the component
$ss = new Zend_Service_SlideShare(&#039;APIKEY&#039;,
                                  &#039;SHAREDSECRET&#039;,
                                  &#039;USERNAME&#039;,
                                  &#039;PASSWORD&#039;);
</pre>

    </div>

    <div class="section" id="zend.service.slideshare.slideshowobj"><div class="info"><h1 class="title">The SlideShow object</h1></div>
        

        <p class="para">
            All slide shows in the <span class="classname">Zend_Service_SlideShare</span> component are
            represented using the <span class="classname">Zend_Service_SlideShare_SlideShow</span> object
            (both when retrieving and uploading new slide shows). For your reference a pseudo-code
            version of this class is provided below.
        </p>

        <pre class="programlisting brush: php">
class Zend_Service_SlideShare_SlideShow {

    /**
     * Retrieves the location of the slide show
     */
    public function getLocation() {
        return $this-&gt;_location;
    }

    /**
     * Gets the transcript for this slide show
     */
    public function getTranscript() {
        return $this-&gt;_transcript;
    }

    /**
     * Adds a tag to the slide show
     */
    public function addTag($tag) {
        $this-&gt;_tags[] = (string)$tag;
        return $this;
    }

    /**
     * Sets the tags for the slide show
     */
    public function setTags(Array $tags) {
        $this-&gt;_tags = $tags;
        return $this;
    }

    /**
     * Gets all of the tags associated with the slide show
     */
    public function getTags() {
        return $this-&gt;_tags;
    }

    /**
     * Sets the filename on the local filesystem of the slide show
     * (for uploading a new slide show)
     */
    public function setFilename($file) {
        $this-&gt;_slideShowFilename = (string)$file;
        return $this;
    }

    /**
     * Retrieves the filename on the local filesystem of the slide show
     * which will be uploaded
     */
    public function getFilename() {
        return $this-&gt;_slideShowFilename;
    }

    /**
     * Gets the ID for the slide show
     */
    public function getId() {
        return $this-&gt;_slideShowId;
    }

    /**
     * Retrieves the HTML embed code for the slide show
     */
    public function getEmbedCode() {
        return $this-&gt;_embedCode;
    }

    /**
     * Retrieves the Thumbnail URi for the slide show
     */
    public function getThumbnailUrl() {
        return $this-&gt;_thumbnailUrl;
    }

    /**
     * Sets the title for the Slide show
     */
    public function setTitle($title) {
        $this-&gt;_title = (string)$title;
        return $this;
    }

    /**
     * Retrieves the Slide show title
     */
    public function getTitle() {
        return $this-&gt;_title;
    }

    /**
     * Sets the description for the Slide show
     */
    public function setDescription($desc) {
        $this-&gt;_description = (string)$desc;
        return $this;
    }

    /**
     * Gets the description of the slide show
     */
    public function getDescription() {
        return $this-&gt;_description;
    }

    /**
     * Gets the numeric status of the slide show on the server
     */
    public function getStatus() {
        return $this-&gt;_status;
    }

    /**
     * Gets the textual description of the status of the slide show on
     * the server
     */
    public function getStatusDescription() {
        return $this-&gt;_statusDescription;
    }

    /**
     * Gets the permanent link of the slide show
     */
    public function getPermaLink() {
        return $this-&gt;_permalink;
    }

    /**
     * Gets the number of views the slide show has received
     */
    public function getNumViews() {
        return $this-&gt;_numViews;
    }
}
</pre>


        <blockquote class="note"><p><b class="note">Note</b>: 
            <p class="para">
                The above pseudo-class only shows those methods which should be used by end-user
                developers. Other available methods are internal to the component.
            </p>
        </p></blockquote>

        <p class="para">
            When using the <span class="classname">Zend_Service_SlideShare</span> component, this data class
            will be used frequently to browse or add new slide shows to or from the web service.
        </p>
    </div>

    <div class="section" id="zend.service.slideshare.getslideshow"><div class="info"><h1 class="title">Retrieving a single slide show</h1></div>
        

        <p class="para">
            The simplest usage of the <span class="classname">Zend_Service_SlideShare</span> component is
            the retrieval of a single slide show by slide show ID provided by the slideshare.net
            application and is done by calling the  <span class="methodname">getSlideShow()</span> method of
            a <span class="classname">Zend_Service_SlideShare</span> object and using the resulting
            <span class="classname">Zend_Service_SlideShare_SlideShow</span> object as shown.
        </p>

        <pre class="programlisting brush: php">
// Create a new instance of the component
$ss = new Zend_Service_SlideShare(&#039;APIKEY&#039;,
                                  &#039;SHAREDSECRET&#039;,
                                  &#039;USERNAME&#039;,
                                  &#039;PASSWORD&#039;);

$slideshow = $ss-&gt;getSlideShow(123456);

print &quot;Slide Show Title: {$slideshow-&gt;getTitle()}&lt;br/&gt;\n&quot;;
print &quot;Number of views: {$slideshow-&gt;getNumViews()}&lt;br/&gt;\n&quot;;
</pre>

    </div>

    <div class="section" id="zend.service.slideshare.getslideshowlist"><div class="info"><h1 class="title">Retrieving Groups of Slide Shows</h1></div>
        

        <p class="para">
            If you do not know the specific ID of a slide show you are interested in retrieving,
            you can retrieving groups of slide shows by using one of three methods:
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    <em class="emphasis">Slide shows from a specific account</em>
                </p>

                <p class="para">
                    You can retrieve slide shows from a specific account by using the
                     <span class="methodname">getSlideShowsByUsername()</span> method and providing the
                    username from which the slide shows should be retrieved
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">Slide shows which contain specific tags</em>
                </p>

                <p class="para">
                    You can retrieve slide shows which contain one or more specific tags by using
                    the  <span class="methodname">getSlideShowsByTag()</span> method and providing one or
                    more tags which the slide show must have assigned to it in order to be retrieved
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">Slide shows by group</em>
                </p>

                <p class="para">
                    You can retrieve slide shows which are a member of a specific group using the
                     <span class="methodname">getSlideShowsByGroup()</span> method and providing the name of
                    the group which the slide show must belong to in order to be retrieved
                </p>
            </li>
        </ul>

        <p class="para">
            Each of the above methods of retrieving multiple slide shows a similar approach is
            used. An example of using each method is shown below:
        </p>

        <pre class="programlisting brush: php">
// Create a new instance of the component
$ss = new Zend_Service_SlideShare(&#039;APIKEY&#039;,
                                  &#039;SHAREDSECRET&#039;,
                                  &#039;USERNAME&#039;,
                                  &#039;PASSWORD&#039;);

$starting_offset = 0;
$limit = 10;

// Retrieve the first 10 of each type
$ss_user = $ss-&gt;getSlideShowsByUser(&#039;username&#039;, $starting_offset, $limit);
$ss_tags = $ss-&gt;getSlideShowsByTag(&#039;zend&#039;, $starting_offset, $limit);
$ss_group = $ss-&gt;getSlideShowsByGroup(&#039;mygroup&#039;, $starting_offset, $limit);

// Iterate over the slide shows
foreach($ss_user as $slideshow) {
   print &quot;Slide Show Title: {$slideshow-&gt;getTitle}&lt;br/&gt;\n&quot;;
}
</pre>

    </div>

    <div class="section" id="zend.service.slideshare.caching"><div class="info"><h1 class="title">Zend_Service_SlideShare Caching policies</h1></div>
        

        <p class="para">
            By default, <span class="classname">Zend_Service_SlideShare</span> will cache any request
            against the web service automatically to the filesystem (default path
            <var class="filename">/tmp</var>) for 12 hours. If you desire to change this behavior, you
            must provide your own <a href="zend.cache.html" class="link">Zend_Cache</a> object using the
             <span class="methodname">setCacheObject()</span> method as shown:
        </p>

        <pre class="programlisting brush: php">
$frontendOptions = array(
                        &#039;lifetime&#039; =&gt; 7200,
                        &#039;automatic_serialization&#039; =&gt; true);
$backendOptions  = array(
                        &#039;cache_dir&#039; =&gt; &#039;/webtmp/&#039;);

$cache = Zend_Cache::factory(&#039;Core&#039;,
                             &#039;File&#039;,
                             $frontendOptions,
                             $backendOptions);

$ss = new Zend_Service_SlideShare(&#039;APIKEY&#039;,
                                  &#039;SHAREDSECRET&#039;,
                                  &#039;USERNAME&#039;,
                                  &#039;PASSWORD&#039;);
$ss-&gt;setCacheObject($cache);

$ss_user = $ss-&gt;getSlideShowsByUser(&#039;username&#039;, $starting_offset, $limit);
</pre>

    </div>

    <div class="section" id="zend.service.slideshare.httpclient"><div class="info"><h1 class="title">Changing the behavior of the HTTP Client</h1></div>
        

        <p class="para">
            If for whatever reason you would like to change the behavior of the
            <acronym class="acronym">HTTP</acronym> client when making the web service request, you can do so by
            creating your own instance of the <span class="classname">Zend_Http_Client</span> object (see
            <a href="zend.http.html" class="link">Zend_Http</a>). This is useful for instance when it is
            desirable to set the timeout for the connection to something other then default as
            shown:
        </p>

        <pre class="programlisting brush: php">
$client = new Zend_Http_Client();
$client-&gt;setConfig(array(&#039;timeout&#039; =&gt; 5));

$ss = new Zend_Service_SlideShare(&#039;APIKEY&#039;,
                                  &#039;SHAREDSECRET&#039;,
                                  &#039;USERNAME&#039;,
                                  &#039;PASSWORD&#039;);
$ss-&gt;setHttpClient($client);
$ss_user = $ss-&gt;getSlideShowsByUser(&#039;username&#039;, $starting_offset, $limit);
</pre>

    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.simpy.html">Zend_Service_Simpy</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="reference.html">Refer&ecirc;ncia do Zend Framework</a></li>
  <li class="header up"><a href="zend.service.html">Zend_Service</a></li>
  <li><a href="zend.service.introduction.html">Introdu&ccedil;&atilde;o</a></li>
  <li><a href="zend.service.akismet.html">Zend_Service_Akismet</a></li>
  <li><a href="zend.service.amazon.html">Zend_Service_Amazon</a></li>
  <li><a href="zend.service.amazon.ec2.html">Zend_Service_Amazon_Ec2</a></li>
  <li><a href="zend.service.amazon.ec2.instance.html">Zend_Service_Amazon_Ec2: Instances</a></li>
  <li><a href="zend.service.amazon.ec2.windows.instance.html">Zend_Service_Amazon_Ec2: Windows Instances</a></li>
  <li><a href="zend.service.amazon.ec2.reserved.instance.html">Zend_Service_Amazon_Ec2: Reserved Instances</a></li>
  <li><a href="zend.service.amazon.ec2.cloudwatch.html">Zend_Service_Amazon_Ec2: CloudWatch Monitoring</a></li>
  <li><a href="zend.service.amazon.ec2.images.html">Zend_Service_Amazon_Ec2: Amazon Machine Images (AMI)</a></li>
  <li><a href="zend.service.amazon.ec2.ebs.html">Zend_Service_Amazon_Ec2: Elastic Block Storage (EBS)</a></li>
  <li><a href="zend.service.amazon.ec2.elasticip.html">Zend_Service_Amazon_Ec2: Elastic IP Addresses</a></li>
  <li><a href="zend.service.amazon.ec2.keypairs.html">Zend_Service_Amazon_Ec2: Keypairs</a></li>
  <li><a href="zend.service.amazon.ec2.zones.html">Zend_Service_Amazon_Ec2: Regions and Availability Zones</a></li>
  <li><a href="zend.service.amazon.ec2.securitygroups.html">Zend_Service_Amazon_Ec2: Security Groups</a></li>
  <li><a href="zend.service.amazon.s3.html">Zend_Service_Amazon_S3</a></li>
  <li><a href="zend.service.amazon.sqs.html">Zend_Service_Amazon_Sqs</a></li>
  <li><a href="zend.service.audioscrobbler.html">Zend_Service_Audioscrobbler</a></li>
  <li><a href="zend.service.delicious.html">Zend_Service_Delicious</a></li>
  <li><a href="zend.service.developergarden.html">Zend_Service_DeveloperGarden</a></li>
  <li><a href="zend.service.ebay.html">Zend_Service_Ebay</a></li>
  <li><a href="zend.service.ebay.finding.html">Zend_Service_Ebay_Finding</a></li>
  <li><a href="zend.service.flickr.html">Zend_Service_Flickr</a></li>
  <li><a href="zend.service.livedocx.html">Zend_Service_LiveDocx</a></li>
  <li><a href="zend.service.nirvanix.html">Zend_Service_Nirvanix</a></li>
  <li><a href="zend.service.recaptcha.html">Zend_Service_ReCaptcha</a></li>
  <li><a href="zend.service.short-url.html">Zend_Service_ShortUrl</a></li>
  <li><a href="zend.service.simpy.html">Zend_Service_Simpy</a></li>
  <li class="active"><a href="zend.service.slideshare.html">Zend_Service_SlideShare</a></li>
  <li><a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a></li>
  <li><a href="zend.service.strikeiron.bundled-services.html">Zend_Service_StrikeIron: Bundled Services</a></li>
  <li><a href="zend.service.strikeiron.advanced-uses.html">Zend_Service_StrikeIron: Advanced Uses</a></li>
  <li><a href="zend.service.technorati.html">Zend_Service_Technorati</a></li>
  <li><a href="zend.service.twitter.html">Zend_Service_Twitter</a></li>
  <li><a href="zend.service.windowsazure.html">Zend_Service_WindowsAzure</a></li>
  <li><a href="zend.service.windowsazure.storage.blob.html">Zend_Service_WindowsAzure_Storage_Blob</a></li>
  <li><a href="zend.service.windowsazure.diagnostics.manager.html">Zend_Service_WindowsAzure_Diagnostics_Manager</a></li>
  <li><a href="zend.service.windowsazure.storage.queue.html">Zend_Service_WindowsAzure_Storage_Queue</a></li>
  <li><a href="zend.service.windowsazure.storage.table.html">Zend_Service_WindowsAzure_Storage_Table</a></li>
  <li><a href="zend.service.yahoo.html">Zend_Service_Yahoo</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>